/*
 * Copyright (c) 2016. zhaojin 15398699939@163.com
 */

package com.bankscene.screenfit.fragment;

import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.Toast;

import com.bankscene.screenfit.R;
import com.bankscene.screenfit.util.RandomUtils;
import com.bankscene.screenfit.vus.TouchIcCardVu;

/**
 * 接触式IC卡
 */
public class TouchIcCardFragment extends BasePresenterFragment<TouchIcCardVu> {

    @Override
    protected Class<TouchIcCardVu> getVuClass() {
        return TouchIcCardVu.class;
    }

    @Override
    protected void onBindVu() {
        super.onBindVu();
        //TODO 测试数据
        vu.setCardNumb(String.valueOf(RandomUtils.getNumbsStyleData(11)));
        vu.setFieldData55(String.valueOf(RandomUtils.getNumbsStyleData(11)));
        Toast.makeText(getContext(), "接触式IC卡", Toast.LENGTH_SHORT).show();
        setHasOptionsMenu(true);
    }

    @Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        inflater.inflate(R.menu.touchiccardfragment_menu, menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.read_card_info:
                Toast.makeText(getContext(),getResources().getText(R.string.dev),Toast.LENGTH_SHORT).show();
                break;
        }
        return true;
    }
}
